package top.likeqc.leetcode.editor.cn;

/**
 * @see <a href="https://leetcode.cn/problems/check-if-the-sentence-is-pangram">leetcode题库</a>
 */
public class CheckIfTheSentenceIsPangram {
    public static void main(String[] args) {
        Solution solution = new CheckIfTheSentenceIsPangram().new Solution();
    }
    // leetcode submit region begin(Prohibit modification and deletion)
    class Solution {
        public boolean checkIfPangram(String sentence) {
            int[] count = new int[26];
            int sum = 0;

            for (char c : sentence.toLowerCase().toCharArray()) {
                if (count[c - 'a']++ == 0) {
                    sum++;
                    if (sum == 26) {
                        return true;
                    }
                }
            }
            return false;
        }
    }
    // leetcode submit region end(Prohibit modification and deletion)

}
